package com.baize.minespace.service.impl;

import com.baize.minespace.mapper.PostsMapper;
import com.baize.minespace.pojo.Posts;
import com.baize.minespace.service.PostsService;
import com.baize.minespace.utils.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 博客文章元数据表 服务实现类
 * </p>
 *
 * @author baize
 * @since 2024-04-15
 * @version ${cfg.version}
 */
@Service
public class PostsServiceImpl extends ServiceImpl<PostsMapper, Posts> implements PostsService {
    @Override
    public Result<IPage<Posts>>selectPostsPage(Integer rows,Integer page,Posts posts){
        Page<Posts> postsPage=new Page<>(rows,page);
        IPage<Posts> postsIPage=baseMapper.selectPostsPage(postsPage, posts);
        return Result.success(postsIPage);
    }
}
